import request from "@/utils/request"

// 数据列表
export function list(params: any) {
    return request({
        method: "get",
        url: "/tienchin/activity/list",
        params
    })
}

// 渠道名称
export function channel(params: any) {
    return request({
        method: "get",
        url: "/tienchin/activity/channel/list",
        params
    })
}

// 活动状态
export function statusData(params: any) {
    return request({
        method: "get",
        url: "/system/dict/data/type/activity_status",
        params
    })
}

// 活动类型
export function typeData(params: any) {
    return request({
        method: "get",
        url: "/system/dict/data/type/activity_type",
        params
    })
}

// 新增
export function addData(data: any) {
    return request({
        method: "post",
        url: "/tienchin/activity",
        data
    })
}

// 修改
export function editData(id: number) {
    return request({
        method: "get",
        url: "/tienchin/activity/"+id,
        data: id
    })
}

// 更新
export function updata(data: any) {
    return request({
        method: "put",
        url: "/tienchin/activity",
        data
    })
}

// 删除
export function delData(id: number) {
    return request({
        method: "delete",
        url: "/tienchin/activity/"+id,
        data: id
    })
}